/**
* 版权所有:版权所有(C) 2020，卓信科技
* 系统名称:IFC-管理系统
* 文件名称:DistrictController.java
* 模块名称:Controller
* 创建日期:2020年5月19日
* 作        者:Baisong
* 内容摘要:Controller
*/
package com.zx.emanage.sysmanage.web;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zx.emanage.sysmanage.service.DistrictService;
import com.zx.emanage.util.gen.ResultHelper;

/**
 * 类 名 称:IfcCreCreditNotificationMessage
 *
 * 内容摘要:Controller
 *
 * 作 者:Baisong
 */
@Controller
public class DistrictController
{
    private static Logger log = LoggerFactory.getLogger(DistrictController.class);

    @Autowired
    private DistrictService districtService;

    @RequestMapping(value = "/sysmanage/getDitrictList.do", method = { RequestMethod.GET, RequestMethod.POST })
    @ResponseBody
    public Map<String, Object> getDitrictListById(@RequestParam("parent_id") int parent_id)
    {
        List<Map<String, Object>> ditrictList = null;
        Map<String, Object> resMap = new HashMap<String, Object>();
        String ret_code = ResultHelper.RET_SUCCESS;
        try
        {
            ditrictList = districtService.getDitrictListById(parent_id);
            resMap.put("list", ditrictList);
        }
        catch (Exception e)
        {
        	ret_code = ResultHelper.RET_ERROR;
            log.debug("{}", e.getMessage());
        }
        return ResultHelper.getReturnData(resMap, ret_code, "");
    }
}
